﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Com.Mapabc.Maps.Api.Events;
using Com.Mapabc.Maps.Api.BaseTypes;

namespace PhoneToolkitSample.Samples
{
    public partial class GetCenter : PhoneApplicationPage
    {
        public GetCenter()
        {
            InitializeComponent();
        }
        private void map_loaded(object sender, MapEventArgs e)
        {
            MyMap.ViewportChanged += new EventHandler<MapEventArgs>(MyMap_ViewportChanged);
        }

        void MyMap_ViewportChanged(object sender, MapEventArgs e)
        {
            MLngLat lnglat = MyMap.Center;
            CenterLngX.Text=String.Format("中心点经度: {0}", Math.Round(lnglat.LngX, 3));
            CenterLatY.Text = String.Format("中心点纬度: {0}", Math.Round(lnglat.LatY, 3));
    
        }
    }
}